<%@ page language="java" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
	<title>公司图片管理</title>
	<script src="${ctx}/static/js/imagePreview.js" type="text/javascript"></script>
	<script>
		$(document).ready(function() {
			//聚焦第一个输入框
			$("#environment_name").focus();
			//为inputForm注册validate函数
			$("#inputEnvironmentForm").validate();
			getImgPath('${ctx}/environment/getImgPath');
		});
	</script>
</head>

<body>
	<form id="inputEnvironmentForm" enctype="multipart/form-data" action="${ctx}/environment/${action}" method="post" class="form-horizontal">
		<input type="hidden" name="id" id="id" value="${environment.id}"/>
		<input type="hidden" name="uploadFileName" id="uploadFileName" value="${uploadFileName}"/>
		<fieldset>
			<legend><small>管理公司图片</small></legend>
			<div class="tabbable"> <!-- Only required for left/right tabs -->
				<ul class="nav nav-tabs">
					<li class="active"><a href="#tab0" data-toggle="tab">基本信息</a></li>
					<li><a href="#tab1" data-toggle="tab">缩略图</a></li>
					<li><a href="#tab2" data-toggle="tab">高清图</a></li>
					<!--  <li><a href="#tab3" data-toggle="tab">视频</a></li>-->
				</ul>
				<div class="tab-content">
				    <div class="tab-pane active" id="tab0">
						<div class="control-group">
							<label for="environment_name" class="control-label">标题:</label>
							<div class="controls">
								<input type="text" id="environment_name" name="name" value="${environment.name}" class="input-large required" minlength="3"/>
							</div>
						</div>
						<div class="control-group">
							<label for="environment_name" class="control-label">简介:</label>
							<div class="controls">
								<div id="localImag0"><img id="prev_img0" src="" alt="简介图" /></div>
					   			<input type='file' id="doc0" name="0" onchange="readLocalImgURL(this,'0');" accept="image/png"/> 
					   			<input type='hidden' id="rid0" name="0" />
				   			</div>
				  		</div>
						<div class="control-group">
							<label for="environment_remark" class="control-label">备注:</label>
							<div class="controls">
								<textarea id="environment_remark" name="remark" class="input-large">${environment.remark}</textarea>
							</div>
						</div>
				    </div>
				    <div class="tab-pane" id="tab1">
				    	<div class="control-group">
							<div class="controls">
				    			<div id="localImag1"><img id="prev_img1" src="" alt="缩略图" /></div>
						    	<input type='file' id="doc1" name="1" onchange="readLocalImgURL(this,'1');" accept="image/png"/>
						    	<input type='hidden' id="rid1" name="1" />
			    			</div>
						</div>
			    	</div>
				   	<div class="tab-pane" id="tab2">
					   	<div class="control-group">
							<div class="controls">
						   		<div id="localImag2"><img id="prev_img2" src="" alt="高清图" /></div>
						   		<input type='file' id="doc2" name="2" onchange="readLocalImgURL(this,'2');" accept="image/png"/> 
						   		<input type='hidden' id="rid2" name="2" />
					   		</div>
						</div>
				  	</div>
				 	<!-- <div class="tab-pane" id="tab3">
				 		<div class="control-group">
							<div class="controls">
			   					<input type='file' id="doc100" name="100"  /> 
			   					<input type='hidden' id="rid100" name="100" />
	   						</div>
						</div>
			      	</div>-->
			 	 </div>
			</div>
			<div class="form-actions">
				<input id="submit_btn" class="btn btn-primary" type="submit" value="提交"/>&nbsp;	
				<input id="cancel_btn" class="btn" type="button" value="返回" onclick="history.back()"/>
			</div>
		</fieldset>
	</form>
</body>
</html>